#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <cstddef>
#include<orbExt.hpp>

using namespace std;
using namespace cv;
int main(int, char **)
{
    Mat left = imread("../img/0.png");
    Mat right = imread("../img/1.png");
    assert(left.data != nullptr && right.data != nullptr);
    vector<KeyPoint> keypoint1, keypoint2;
    Ptr<FeatureDetector> fast = FastFeatureDetector::create(40);
    fast->detect(left, keypoint1);
    fast->detect(right, keypoint2);
    // cout <<keypoint1[0].pt.x<<endl;
    vector<DescType> descpt1;
    vector<DescType> descpt2;
    computeORB(left, keypoint1, descpt1);
    computeORB(right, keypoint2, descpt2);
    vector<DMatch> matches;
    BfMatc(descpt1, descpt2, matches);
    Mat matchimg;
drawMatches(left,keypoint1,right,keypoint2,matches,matchimg);
imshow("match",matchimg);
imwrite("imgMatch.png",matchimg);
waitKey(0);
    return 0;
}
